-
Notifications
You must be signed in to change notification settings - Fork 656
Form: fix get item by path (T1311534) #31492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the Form component's itemOption method when retrieving items by path where multiple items share the same name or caption (T1311534). The fix ensures path-based lookups correctly traverse nested groups and return the intended item rather than the first matching name.
Key changes:
- Fixed the
_getFieldPartsmethod to correctly reverse the path array after splitting - Added validation in
_getItemByFieldPathto ensure the path node matches before retrieving nested items - Changed return types from
falsetonullfor consistency with TypeScript conventions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/devextreme/testing/tests/DevExpress.ui.widgets.form/form.tests.js | Added test case verifying itemOption retrieves correct items by path when duplicates exist |
| packages/devextreme/js/__internal/ui/form/form.utils.ts | Changed return type from false to null for consistency |
| packages/devextreme/js/__internal/ui/form/form.ts | Fixed path parsing logic and added path validation to prevent incorrect item matching |
b5480bc to
a1c242f
Compare
a1c242f to
6a6a1c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
6a6a1c7 to
ad9448a
Compare
ad9448a to
69fa561
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
packages/devextreme/testing/tests/DevExpress.ui.widgets.form/form.label.tests.js
Outdated
Show resolved
Hide resolved
3e07deb to
482e249
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
482e249 to
dd122f0
Compare
dd122f0 to
9a2732e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
No description provided.